<template>
  <view class="detail-container">
    <view class="post-content">
      <view class="author-info">
        <image src="/static/avatar1.png" class="avatar" />
        <view class="author-meta">
          <text class="name">朋知云学官方</text>
          <text class="time">2023-09-01</text>
        </view>
      </view>
      
      <view class="post-meta">
        <text class="subject-tag">用户守则</text>
      </view>
      
      <view class="content-section">
        <text class="section-title">用户守则</text>
        
        <view class="rules-section">
          <text class="rules-subtitle">1. 内容发布规范</text>
          <text class="rules-text">发布的内容必须真实、准确，不得发布虚假信息或误导性内容。支教需求应详细说明学校情况、需求科目、时间安排等关键信息，便于志愿者了解情况。</text>
        </view>
        
        <view class="rules-section">
          <text class="rules-subtitle">2. 禁止内容</text>
          <text class="rules-text">严禁发布任何违反国家法律法规的内容，包括但不限于色情、暴力、赌博、诈骗等信息。禁止发布侵犯他人隐私、名誉权的内容，禁止发布商业广告或与支教无关的信息。</text>
        </view>
        
        <view class="rules-section">
          <text class="rules-subtitle">3. 文明互动</text>
          <text class="rules-text">用户之间交流应文明礼貌，相互尊重，禁止人身攻击、辱骂、歧视等不当言论。鼓励用户分享支教经验和心得，共同促进教育资源均衡发展。</text>
        </view>
        
        <view class="rules-section">
          <text class="rules-subtitle">4. 个人信息保护</text>
          <text class="rules-text">请勿在公开区域发布个人敏感信息，如身份证号、详细住址等。联系方式建议通过申请组队功能私下交流，保护个人隐私安全。</text>
        </view>
        
        <view class="rules-section">
          <text class="rules-subtitle">5. 知识产权保护</text>
          <text class="rules-text">尊重原创内容，发布教学资料时应注明来源。未经授权，不得使用他人享有著作权的内容，包括但不限于文字、图片、视频等。</text>
        </view>
        
        <view class="rules-section">
          <text class="rules-subtitle">6. 违规处理</text>
          <text class="rules-text">对违反上述规定的内容，平台有权予以删除；对屡次违规的用户，平台将视情节轻重给予警告、限制功能使用或永久封禁等处理。</text>
        </view>
      </view>
      
      <view class="interaction-bar">
        <view class="post-actions">
          <view class="action-item">
            <image src="/static/分享1.png" class="action-icon" mode="aspectFit"></image>
            <text>分享</text>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      post: {
        id: 'pinned-2',
        title: '用户守则',
        content: '用户守则：请文明发言，不得发布违法违规内容，尊重原创，不侵犯他人知识产权，违规内容将被删除。'
      }
    }
  },
  methods: {
    sharePost() {
      uni.share({
        provider: "weixin",
        scene: "WXSceneSession",
        type: 0,
        title: "朋知云学 - 用户守则",
        summary: this.post.content,
        success: function() {
          uni.showToast({
            title: '分享成功',
            icon: 'success'
          })
        }
      })
    }
  },
  onShareAppMessage() {
    return {
      title: "朋知云学 - 用户守则",
      path: `/pages/post/rules`
    }
  }
}
</script>

<style lang="scss" scoped>
.detail-container {
  min-height: 100vh;
  background: #f5f7fa;
  padding: 30rpx;
  
  .post-content {
    background: #fff;
    border-radius: 20rpx;
    padding: 40rpx;
    box-shadow: 0 8rpx 24rpx rgba(0,0,0,0.08);
    
    .author-info {
      display: flex;
      align-items: center;
      margin-bottom: 30rpx;
      
      .avatar {
        width: 80rpx;
        height: 80rpx;
        border-radius: 50%;
        margin-right: 20rpx;
        border: 2rpx solid rgba(91,192,235,0.2);
      }
      
      .author-meta {
        flex: 1;
        
        .name {
          font-size: 32rpx;
          color: #2c3e50;
          font-weight: 500;
          display: block;
        }
        
        .time {
          font-size: 24rpx;
          color: #94a3b8;
        }
      }
    }
    
    .post-meta {
      display: flex;
      align-items: center;
      margin-bottom: 30rpx;
      
      .subject-tag {
        background: rgba(91,192,235,0.1);
        color: #5bc0eb;
        padding: 8rpx 20rpx;
        border-radius: 30rpx;
        font-size: 24rpx;
        margin-right: 20rpx;
      }
    }
    
    .content-section {
      margin-bottom: 40rpx;
      
      .section-title {
        font-size: 36rpx;
        font-weight: 600;
        color: #2c3e50;
        margin-bottom: 30rpx;
        display: block;
      }
      
      .rules-section {
        margin-bottom: 30rpx;
        
        .rules-subtitle {
          font-size: 30rpx;
          font-weight: 500;
          color: #334155;
          margin-bottom: 16rpx;
          display: block;
        }
        
        .rules-text {
          font-size: 28rpx;
          color: #64748b;
          line-height: 1.6;
          display: block;
        }
      }
    }
    
    .interaction-bar {
      margin-top: 40rpx;
      border-top: 2rpx solid #f1f5f9;
      padding-top: 30rpx;
      
      .post-actions {
        display: flex;
        justify-content: center;
        align-items: center;
        
        .action-item {
          display: flex;
          align-items: center;
          padding: 15rpx 30rpx;
          border-radius: 8rpx;
          transition: all 0.2s ease;
          
          &:active {
            background: #f1f5f9;
            transform: scale(0.95);
          }
          
          .action-icon {
            width: 32rpx;
            height: 32rpx;
          }
          
          text {
            margin-left: 12rpx;
            font-size: 28rpx;
            color: #64748b;
          }
        }
      }
    }
  }
}
</style>